package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

/**
 * 回帖实体类
 */
@TableName("t_reply")
public class ReplyBean {
    /**编号*/
    @TableId(value = "pk_replyId",type = IdType.AUTO)
    private Integer replyId;
    /**标题*/
    @TableField("r_title")
    private String title;
    /**内容*/
    @TableField("r_content")
    private String content;
    /**主贴id*/
    @TableField("fk_stickId")
    private Integer stickId;
    /**主贴对象*/
    @TableField(exist = false)
    private StickBean stickBean;
    /**回帖人Id*/
    @TableField("fk_userId")
    private Integer userId;
    /**回帖对象*/
    @TableField(exist = false)
    private UserBean user;
    /**回帖时间*/
    @TableField("r_replyDate")
    private LocalDate replyDate = LocalDate.now();

    public ReplyBean() {
    }

    public ReplyBean(String title, String content, Integer stickId, Integer userId) {
        this.title = title;
        this.content = content;
        this.stickId = stickId;
        this.userId = userId;
    }

    public Integer getReplyId() {
        return replyId;
    }

    public void setReplyId(Integer replyId) {
        this.replyId = replyId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getStickId() {
        return stickId;
    }

    public void setStickId(Integer stickId) {
        this.stickId = stickId;
    }

    public StickBean getStickBean() {
        return stickBean;
    }

    public void setStickBean(StickBean stickBean) {
        this.stickBean = stickBean;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public LocalDate getReplyDate() {
        return replyDate;
    }

    public void setReplyDate(LocalDate replyDate) {
        this.replyDate = replyDate;
    }

    @Override
    public String toString() {
        return "ReplyBean{" +
                "replyId=" + replyId +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", stickId=" + stickId +
                ", stickBean=" + stickBean +
                ", userId=" + userId +
                ", user=" + user +
                ", replyDate=" + replyDate +
                "}\n";
    }
}
